package cn.seaboot.admin.excel.service;

import cn.seaboot.admin.excel.bean.ExcelRow;
import cn.seaboot.admin.excel.dao.ExcelRowDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* Service
* Excel内容 [t_excel_row]
* @author Mr.css on 2018-6-20
*/
@Service
public class ExcelRowService {

    @Resource
    private ExcelRowDao excelRowDao;

    /**
     * 增
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int insert(ExcelRow pojo){
        return excelRowDao.insert(pojo);
    }

    /**
     * 删
     *
     * @param id id
     * @return affected rows
     */
    public int deleteById(Long id){
        return excelRowDao.deleteById(id);
    }

    /**
     * 改
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int updateById(ExcelRow pojo) {
        return excelRowDao.updateSampleById(pojo);
    }

    /**
     * 查
     *
     * @param id id
     * @return pojo
     */
    public ExcelRow queryById(Long id){
        return excelRowDao.selectById(id);
    }

    /**
     * 查列表
     *
     * @param params 参数
     * @return list
     */
    public List<ExcelRow> queryList(Map<String, Object> params) {
        return excelRowDao.selectList(params);
    }
}
